import React, { useState, useEffect, useContext, createContext } from 'react'
const NameContext = createContext()

export default function TestuseState() {
  return (
    <NameContext.Provider value='zjd'>
      <Son />
    </NameContext.Provider>
  )
}

function Son(props) {
  const nameContextSon = useContext(NameContext)
  return (
    <div>
      Son <br /> {nameContextSon}
    </div>
  )
}
